<template>
  <CategorySelector :disabled="isShow !== 1" />
  <SpuList
    v-if="isShow === 1"
    @setIsShow="isShow = $event"
    @setSpu="spu = $event"
  />
  <SaveOrUpdateSpu
    v-else-if="isShow === 2"
    @setIsShow="isShow = $event"
    :spu="spu"
  />
  <SaveSku v-else @setIsShow="isShow = $event" :spu="spu" />
</template>

<script lang="ts">
export default {
  name: "XSpu",
};
</script>
<script lang="ts" setup>
import CategorySelector from "@/components/CategorySelector/index.vue";
import SpuList from "./components/SpuList.vue";
import { ref } from "vue";
import SaveOrUpdateSpu from "./components/SaveOrUpdateSpu.vue";
import SaveSku from "./components/SaveSku.vue";

const isShow = ref(1);
const spu = ref({
  spuName: "",
  tmId: undefined,
  description: "",
  spuImageList: [],
  spuSaleAttrList: [],
});
</script>
<style></style>
